#ifndef _THREADPOOL_H
#define _THREADPOOL_H
#include "TaskQueue.h"
#include "Thread.h"
#include <vector>
#include <memory>
using std::unique_ptr;
using std::vector;
class Threadpool
{
public:
    Threadpool(int, int);
    void start();
    void stop();
    void addTask(Task &&);
    void doTask();

private:
    vector<unique_ptr<Thread>> _threads;
    int _threadNum;
    int _queSize;
    TaskQueue _que;
    bool _isExit;
};

#endif
